package com.kinyx.framework.db.sentence.res.demo.select.sql.method;

import org.junit.Test;

import com.kinyx.framework.db.sentence.res.demo.select.SELECT__SUPER;
import com.kinyx.test.entities.impl.DemoEntityR;

public class SELECT_Tester_SQL_orderBy extends SELECT__SUPER {

	@Override
	protected boolean isSQL() { return true; }

	@Test
	public void test11() {
		final String sentence = "SELECT ORDER BY demoEntity.ID ASC";
		final String str = "SQL: [" + sentence + "], params: []";
		this.test(//
				this.select.orderBy(DemoEntityR.id.asc(true)), //
				sentence, str);
	}

	@Test
	public void test12() {
		final String sentence = "SELECT ORDER BY demoEntity.USING_STATUS DESC";
		final String str = "SQL: [" + sentence + "], params: []";
		this.test(//
				this.select.orderBy(DemoEntityR.usingStatus.asc(false)), //
				sentence, str);
	}

	@Test
	public void test21() {
		final String sentence = "SELECT ORDER BY demoEntity1.ID ASC";
		final String str = "SQL: [" + sentence + "], params: []";
		this.test(//
				this.select.orderBy(DemoEntityR.id.idx(1).asc(true)), //
				sentence, str);
	}

	@Test
	public void test22() {
		final String sentence = "SELECT ORDER BY demoEntity1.USING_STATUS DESC";
		final String str = "SQL: [" + sentence + "], params: []";
		this.test(//
				this.select.orderBy(DemoEntityR.usingStatus.idx(1).asc(false)), //
				sentence, str);
	}

}
